package com.census.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * Created by WangKai's Hands.
 * User:WangKai
 * Date:2017/7/9
 * Time:14:11
 * Email: 1786025737@qq.com
 */
@Entity
public class Nation {
    private int nationId;
    private String nationName;

    @Id
    @Column(name = "nation_id")
    public int getNationId() {
        return nationId;
    }

    public void setNationId(int nationId) {
        this.nationId = nationId;
    }

    @Basic
    @Column(name = "nation_name")
    public String getNationName() {
        return nationName;
    }

    public void setNationName(String nationName) {
        this.nationName = nationName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Nation nation = (Nation) o;

        if (nationId != nation.nationId) return false;
        if (nationName != null ? !nationName.equals(nation.nationName) : nation.nationName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = nationId;
        result = 31 * result + (nationName != null ? nationName.hashCode() : 0);
        return result;
    }
}
